<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>芯芸科技登录</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">

    <meta name="csrf-token" content="{{ csrf_token() }}"/>

    <link rel="stylesheet" href="/dist/home/css/bootstrap.min.css">
    <link rel="stylesheet" href="/dist/home/css/main.css">
    <link rel="stylesheet" href="/dist/home/css/login.css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="/dist/admin/js/html5shiv.min.js"></script>
    <script src="/dist/admin/js/respond.min.js"></script>

    <![endif]-->
</head>
<body>
<div class="login-box">

    <div class="g-header container clearfix">
        <div class="logo"></div>
        <div class="links">
            <a href="#" class="btn btn-default btn-login">登录</a>
        </div>
        <ul class="header-nav">
            <li><a href="#">首页</a></li>
            <li><a href="#">光伏发电解决方案</a></li>
            <li><a href="#">关于我们</a></li>
            <li><a href="#">联系我们</a></li>
        </ul>

    </div>

    <div class="container">
        <div class="form-box clearfix">
            <div class="left-form">
                <form id="J-form" action="/auth/login" method="post">
                    <h1>芯芸光伏发电管理系统</h1>
                    <div class="sub-title clearfix">
                        <div class="l-line"></div>
                        <span class="text">登录LOGIN</span>
                        <div class="r-line"></div>
                    </div>
                    <div class="form-group has-feedback">
                        <i class="glyphicon glyphicon-envelope form-control-feedback pull-left"></i>
                        <input name="name" type="text" class="form-control" placeholder="用户名">
                    </div>
                    <div class="form-group has-feedback">
                        <i class="glyphicon glyphicon-lock form-control-feedback"></i>
                        <input name="password" type="password" class="form-control" placeholder="密码">
                    </div>
                    <div class="form-group">
                        <button type="submit" class="btn btn-primary btn-block btn-flat">登录</button>
                    </div>
                    <div class="form-group">
                        <a href="javascript:alert('请联系管理员');" class="forget-link pull-right">忘记密码</a>
                    </div>
                </form>
            </div>

            <div class="right-img">

            </div>
        </div>

        <div class="footer">
            <a href="http://www.beian.miit.gov.cn">浙ICP备16018802号</a>
        </div>

    </div>

</div>
<!-- /.login-box -->

<!-- jQuery 2.1.4 -->
<script src="/dist/home/js/jquery.min.js"></script>
<!-- Bootstrap 3.3.5 -->
<script src="/dist/home/js/bootstrap.min.js"></script>

<script src="/dist/home/js/jquery.form.js"></script>
<script src="/dist/home/js/validator_show_util.js"></script>

<script>
    //csrf-token
    $.ajaxSetup({
        headers: {
            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
        }
    });
</script>


<script>
    $(function () {
        var height=$(window).height();
        $('.login-box').css({
            height:height
        });

    });


    $(function () {
        $('#J-form').ajaxForm({
            beforeSubmit: function () {
                validator_info_clear($('#J-form'));
            },
            success: function (data) {
                if (data.status == 1) {
                    window.location.href = '/auth/login-success';
                } else {
                    alert(data.error_msg);
                }
            },
            error: function (xhr) {
                validator_info_show($('#J-form'), xhr);
            }
        });
    });

</script>
</body>
</html>
